package com.xdq.spring.service;

import com.xdq.spring.dao.EngineDAO;
import com.xdq.spring.model.Engine;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class EngineService {

    @Resource
    private EngineDAO engineDAO;

    public Engine findByBrand(String brand){
        return engineDAO.findByBrand(brand);
    }

    public List<Engine> list() {
        return engineDAO.findAll();
    }

    public void add(Engine newEngine) {
        engineDAO.add(newEngine);
    }
}
